<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <script src="react-demos/build/react.development.js"></script>
        <script src="react-demos/build/react-dom.development.js"></script>
        <script src="react-demos/build/babel.min.js"></script>
        <script src="react-demos/build/prop-types.js"></script>  /* 注意！要导包咯 */
    </head>
    <body>
        <div id="example"></div>
        <script type="text/babel">
          var data = 123; //js是弱语言，此时值为123的data变量为number类型。
          class MyTitle extends React.Component {
            propTypes = {
              title: PropTypes.string.isRequired, /*指定title必须为string*/
            };
            render() {
              return <h1> {this.props.title} </h1>;
            }
          }
          ReactDOM.render(
            <MyTitle title={data} />, /*强制转类型，不过js的类型好像用的时候区分不大吧，先mark*/
            document.getElementById('example')
          );
        </script>
      </body>
</html>